package _72

func addSpaces(s string, spaces []int) string {
	//bs := []byte(s)
	//for i, v := range spaces {
	//	bs = append(bs[:v+i], append([]byte{' '}, bs[v+i:]...)...)
	//}
	//return string(bs)

	bs := make([]byte, 0)
	j := 0
	n := len(spaces)
	for i, _ := range s {
		if j < n && i == spaces[j] {
			bs = append(bs, ' ', s[i])
			j++
		} else {
			bs = append(bs, s[i])
		}
	}
	return string(bs)
}
